package com.citrinus.feedme;

import android.app.Application;
import android.graphics.Typeface;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.citrinus.feedme.db.Database;

public class App extends Application {
	
	private final static String robotFont = "fonts/Roboto-Regular.ttf";
	private final static String robotBoldFont = "fonts/Roboto-Bold.ttf";
	private static Typeface robot;
	private static Typeface robotBold;
	private Database db;
	public static App instance;
	
	@Override
	public void onCreate() {
		super.onCreate();
		instance = this;
		db = new Database(this);
		db.open();
		robot = Typeface.createFromAsset(getAssets(), robotFont);
		robotBold = Typeface.createFromAsset(getAssets(), robotBoldFont);
	}

	public void setTopBar(SherlockFragmentActivity activity) {
		ActionBar topBar = activity.getSupportActionBar();
		topBar.setDisplayHomeAsUpEnabled(true);
		topBar.setDisplayShowCustomEnabled(true);
		topBar.setDisplayUseLogoEnabled(true);
		topBar.setHomeButtonEnabled(true);
		topBar.setDisplayShowHomeEnabled(true);
		topBar.setLogo(R.drawable.list);
		topBar.setTitle(R.string.app_name);
	}

	public static Typeface getRobot() {
		return robot;
	}
	
	public static Typeface getRobotBold() {
		return robotBold;
	}

	public Database getDb() {
		return db;
	}
	
	
}
